var $$importConfig = {
	context_path : $path,
	file_suffix : ".js",
	resource_path : "/resources",
	module_path : "/resources/module",
	package_prefix : "com.joypard"
};
var $import = function() {
	var config = $_getloadParams(arguments);
	config.className = config.url;
	$$importConfig.loadedJsHash = $$importConfig.loadedJsHash || {};
	if ($$importConfig.loadedJsHash[config.className] && !config.alway === true) {
		return;
	}
	config.url = $$importConfig.context_path //
			+ $$importConfig.module_path + "/"//
			+ config.url.replace(new RegExp("\\.", "gm"), "/")//
			+ $$importConfig.file_suffix;
	$$importConfig.loadedJsHash[config.className] = true;
	$loadjs(config);
};
var $loadjs = function() {
	var config = $_getloadParams(arguments);
	var options = $.extend({
		type : "GET",
		async : false,
		scriptCharset : "utf-8",
		success : function(ignore) {
			var a = config.className.split(".");
			eval("window['" + a[a.length - 1] + "'] = " + config.className + ";");
			// alert("load " + config.className + " successfully!");
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			alert("不能加载类 : " + config.className + "\n消息：" + errorThrown.message);
		}
	}, config);
	options.dataType = "script";
	$.ajax(options);
};
var $_getloadParams = function(args) {
	var config = args[0];
	if (typeof (config) == "string") {
		config = {
			url : config
		};
		if (args[1]) {
			config.success = args[1];
			if (args[2]) {
				config.error = args[2];
			}
		}
	}
	return config;
};